
#include <stdbool.h>
#include <aos/aos.h>
#include <yoc/yoc.h>
#include <devices/devicelist.h>

#include "pin_name.h"
#include "app_init.h"
//#include "pin.h"
#include "calc_acc.h"
#include "platform.h"
#include "aos/cli.h"
#include "yoc/partition.h"
const char *TAG = "INIT";

#ifndef CONSOLE_IDX
#define CONSOLE_IDX 0
#endif

void board_cli_init(void);
void platform_init(void);

static void board_pinmux_config(void)
{
    uart1_io_init(PB00,PB01);
}

void board_base_init(void)
{

}

void board_yoc_init()
{
    platform_init();
    board_pinmux_config();
    console_init(CONSOLE_IDX, 921600, 128);
    ulog_init();
    aos_set_log_level(AOS_LL_DEBUG);
    LOGI(TAG, "Build:%s,%s",__DATE__, __TIME__);
    /* load partition */
    int ret = partition_init();
    if (ret <= 0) {
        LOGE(TAG, "partition init failed");
    } else {
        LOGI(TAG, "find %d partitions", ret);
    }

    ret = aos_kv_init("kv");
    if(ret<0)
    {
        LOGE(TAG, "kv init failed");
    }

    board_cli_init();

}
